import java.util.HashMap;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 09 - 24
 * Time: 9:27
 */
//牛客 删除公共字符
public class Solution2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str1 = in.nextLine();
            String str2 = in.nextLine();
            HashMap<Character, Integer> map = new HashMap<>();
            for (int i = 0; i < str2.length(); i++) {
                if(map.get(str2.charAt(i)) == null) {
                    map.put(str2.charAt(i), 1);
                }else {
                    map.put(str2.charAt(i), map.get(str2.charAt(i)) + 1);
                }
            }
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < str1.length(); i++) {
                if(map.get(str1.charAt(i)) == null) {
                    stringBuilder.append(str1.charAt(i));
                }
            }
            System.out.println(stringBuilder);
        }
    }
}
